import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import Home from '@/views/Home'
import List from '@/views/List'
import News from '@/views/News'
import Profile from '@/views/Profile'
import Homm from '@/views/homm'
import City from '@/views/City'
import Search from '@/views/List/search.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/city',
    component: City
  },
  {
    path: '/search',
    component: Search
  },
  {
    path: '/home',
    component: Home,
    children: [
      {
        path: 'list',
        component: List
      },
      {
        path: 'news',
        component: News
      },
      {
        path: 'profile',
        component: Profile
      },
      {
        path: 'home',
        component: Homm
      }
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
